﻿{include file="public/header"}
<title>问题修改</title>
</head>
<body>

<style>
    .form-label{
        width: 15% !important;
    }
</style>
<article class="page-container">
    <form action="" method="post" class="form form-horizontal" >
        <input type="hidden" value="{$data.id}" name="id">
    {if condition="$data['parent_id'] == 0"}
    <div class="ch-row ch-info-form">
        <div class="flex1">标题：</div>
        <div class="flex2">
            <input type="text"  name="title" class="title form-control" value="{$data.title}">
        </div>
    </div>
    {else}
    <div class="ch-row ch-info-form">
        <div class="flex1">标题：</div>
        <div class="flex2">
            <input type="text"  name="title" class="title form-control" value="{$data.title}">
        </div>
    </div>
    <div class="ch-row ch-info-form">
        <div class="flex1">使用材料：</div>
        <div class="flex2">
            <textarea class="form-control" name="material">{$data.material}</textarea>
        </div>
    </div>
    <div class="ch-row ch-info-form">
        <div class="flex1">适用场景：</div>
        <div class="flex2">
            <textarea class="form-control" name="scen">{$data.scen}</textarea>
        </div>
    </div>
    <div class="ch-row ch-info-form">
        <div class="flex1">温馨提示：</div>
        <div class="flex2">
            <textarea class="form-control" name="prompt">{$data.prompt}</textarea>
        </div>
    </div>
    <div class="ch-row ch-info-form">
        <div class="flex1">价格：</div>
        <div class="flex2">
            <input type="text"  name="price" class="form-control" value="{$data.price}">
        </div>
    </div>
    <div class="ch-row ch-info-form">
        <div class="flex1">价格规则：</div>
        <div class="flex2">
            <textarea class="form-control" name="price_rule">{$data.price_rule}</textarea>
        </div>
    </div>
    <div class="ch-row ch-info-form">
        <div class="flex1">单位：</div>
        <div class="flex2">
            <select class="form-control" name="unit_id">
                <option selected="selected" value="{$data.unit_id}">{$data.titles}</option>
                {volist name='g' id='v'}
                <option value="{$v.id}">{$v.title}</option>
                {/volist}
            </select>
        </div>
    </div>
    <div class="ch-row ch-info-form">
        <div class="flex1">服务内容：</div>
        <div class="flex2">
            <textarea class="form-control" name="service_content">{$data.service_content}</textarea>
        </div>
    </div>
    <div class="ch-row ch-info-form">
        <div class="flex1">服务工期：</div>
        <div class="flex2">
            <textarea class="form-control" name="service_times">{$data.service_times}</textarea>
        </div>
    </div>
    {/if}
    <div class="ch-row ch-info-form">
        <div class="flex1">
            <button class="btn btn-primary radius" style="width: 100%;" type="button"><i class="Hui-iconfont">&#xe632;</i> 提交</button>
        </div>
    </div>
    </form>
</article>

{include file="public/footer"}
<script>
    $('.radius').click(function () {
        var src="{:Url('index/config/edi')}";
            $.ajax({
                type: 'POST',
                url: src,
                dataType: 'json',
                data:$('form').serializeArray(),
                success: function (data) {
                    var res=JSON.parse(data);
                    if(res.code==200){
                        parent.location.reload();

                    }else{
                        layer.msg(res.msg,{icon: 5,time:1000});
                    }

                },
                error: function (data) {
                    console.log(data.msg);
                },
            });



    });
</script>
</body>
</html>